package com.hertz.iris.view.alert;

import java.util.List;

import android.view.LayoutInflater;

import com.github.kevinsawicki.wishlist.SingleTypeAdapter;
import com.hertz.iris.R;
import com.hertz.iris.pojo.ResponseIsAlert;

public class MatchAlarmAlertListAdapter extends SingleTypeAdapter<ResponseIsAlert> {
	/**
     * @param inflater
     * @param items
     * @param selectable
     */
    public MatchAlarmAlertListAdapter(LayoutInflater inflater, List<ResponseIsAlert> items) {
        super(inflater, R.layout.match_alert_item);
        setItems(items);
    }

    /**
     * @param inflater
     * @param items
     */
    public MatchAlarmAlertListAdapter(LayoutInflater inflater) {
        this(inflater, null);
    }

    @Override
    protected int[] getChildViewIds() {
        return new int[] {R.id.host_name,R.id.guest_name,R.id.match_status_text,R.id.host_score,R.id.guest_score};
    }

    @Override
    protected void update(int position, ResponseIsAlert responseIsAlert) {
    	setText(0,responseIsAlert.getHostTeam().getAlias());
    	setText(1,responseIsAlert.getGuestTeam().getAlias());
    	setText(2,responseIsAlert.getMatchNba().getStatus());
    	setText(3,responseIsAlert.getMatchNba().getHostScore().toString());
    	setText(4,responseIsAlert.getMatchNba().getGuestScore().toString());
    }
}
